<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<StockExchanger.Models.BuySell>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ShareList
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>All Listed Shares</h2>

    <table>
        <tr>
            <th></th>
<!--
            <th>
                Id
            </th>
 -->
            <th>
                ListedBy
            </th>
            <th>
                Item
            </th>
            <th>
                Quantity
            </th>
            <th>
                Rate
            </th>
            <th>
                StartDate
            </th>
            <th>
                BoughtBy
            </th>
            <th>
                EndDate
            </th>
            <th>
                IsSold
            </th>
            <th>
                Description
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
 <!--               <%= Html.ActionLink("Edit", "Edit", new { id=item.BuySellId }) %> |     -->
                <%= Html.ActionLink("Details", "Details", new { id=item.BuySellId })%>
            </td>
            <!--
            <td>
                <%= Html.Encode(item.Id) %>
            </td>
            -->
            <td>
                <%= Html.Encode(item.ListedBy) %>
            </td>
            <td>
                <%= Html.Encode(item.Item) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:F}", item.Quantity)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:F}", item.Rate)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.StartDate)) %>
            </td>
            <td>
                <%= Html.Encode(item.BoughtBy) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.EndDate)) %>
            </td>
            <td>
                <%= Html.Encode(item.Sold) %>
            </td>
            <td>
                <%= Html.Encode(item.Description) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Sell a New Item", "Sell") %>
    </p>
    <p>
        <%= Html.ActionLink("Show Only Items Yet to be Purchased", "ShareList") %>
    </p>

</asp:Content>

